home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / BSCRIPTS.CST / 00011_Script_hendlers < prev    next >
Text File  |  1999-04-25  |  9KB  |  350 lines

  1. -- ⌐ 1998 @radical.media, inc. & Concurrent New Media Group, L.L.C.
  2. -- Developed for Bombardier, Inc.
  3. --
  4. -- All programming developed by: 
  5. -- Robert Fabricant, Valerie Valoueva, Ossi Shaked, 
  6. -- Henry Sauvageot, Chris Howell & Chris Girand
  7. --
  8. -- Use of this code by parties other than @radical.media, inc. or their
  9. --agents 
  10. -- without the express written consent of @radical.media, inc. AND Concurrent 
  11. -- New Media Group, L.L.C. is strictly prohibited.
  12. ------------------------------------------------------
  13.  
  14.  
  15.  
  16. global gMstones,gMSIndex,gMSpos
  17. global gRtrnPln
  18.  
  19.  
  20. -----------------------------------------------------------
  21. --    qtvr handlers
  22. --Check out  script 2 in internal-scripts of "CH604.dir" movie
  23. --for details on how QTVR exit frame script works
  24. -------------------------------------------------------------
  25.  
  26. on openextra
  27.   --  
  28. end
  29.  
  30. on openextra2
  31.   global gQTVRObj,oldIndex,hotspot
  32.   
  33.   set oldIndex = 0
  34.   set hotspot ="no"
  35.   QTVREnter(xtra "QTVRXtra")
  36.   -- create an object from the QTVR XTRA
  37.   set gQTVRObj = new(xtra "QTVRXtra")
  38. end
  39.  
  40. on closemovie
  41.   if IsQTVRMovie(gQTVRObj) then QTVRClose(gQTVRObj)
  42.   put "closeM"
  43. end
  44.  
  45. on openmovie Movie,mode
  46.   global gQTVRObj
  47.   
  48.   set QTVRRect = rectToStr(the rect of sprite 6)
  49.   
  50.   if IsQTVRMovie(gQTVRObj) then
  51.     --QTVRClose(gQTVRObj)
  52.   else
  53.     put "movie open"
  54.     QTVROpen(gQTVRObj,Movie, QTVRRect,mode)
  55.     if the result contains "Error" then
  56.       if the runmode = "author" then alert the result
  57.     end if
  58.     if QTVRgetQTVRType(gQTVRObj)="QTVRPanorama" then SetCallBacks
  59.   end if
  60. end
  61.  
  62. on closeextra2
  63.   global gQTVRObj
  64.   put gQTVRObj, "close"
  65.   if IsQTVRMovie(gQTVRObj) then QTVRClose(gQTVRObj)
  66.   
  67.   QTVRExit(xtra "QTVRXtra")
  68. end
  69.  
  70. on closeextra
  71.   --
  72. end
  73.  
  74. on rectToStr myRect
  75.   set myString = string(myRect)
  76.   delete char 1 to 5 of myString
  77.   delete char (the length of myString) of myString
  78.   return myString
  79. end
  80.  
  81. on pointToStr myPoint
  82.   set myString = string(myPoint)
  83.   delete char 1 to 6 of myString
  84.   delete char (the length of myString) of myString
  85.   return myString
  86. end
  87.  
  88. --------------------------------------------------------
  89. -- ExtractPathName
  90. --      pFileName is the full file path of the file
  91. -- Returns the path component of pFileName
  92. --
  93. -- Extracts and returns the path component of a file specifier.
  94. ----------------------------------------------------------------
  95. on ExtractPathName pPathName
  96.   put ":" into tDelimiter
  97.   if pPathName contains tDelimiter then
  98.     put length(pPathName) into tCharPos
  99.     repeat while tCharPos >= 1
  100.       if char tCharPos of pPathName = tDelimiter then return char 1 to tCharPos - 1 of pPathName
  101.       put tCharPos - 1 into tCharPos
  102.     end repeat
  103.     return empty
  104.   else
  105.     return empty
  106.   end if
  107. end
  108.  
  109. on setCallbacks
  110.   global gQTVRObj
  111.   QTVRSetRollOverHotSpotHandler (gQTVRObj,"rolloverHS")
  112.   QTVRSetMouseOverHandler (gQTVRObj,empty)
  113.   QTVRSetMouseDownHandler (gQTVRObj,empty)
  114.   QTVRSetMouseStillDownHandler (gQTVRObj,empty)
  115.   QTVRSetPanZoomStartHandler (gQTVRObj,empty)
  116.   QTVRSetNodeLeaveHandler (gQTVRObj,empty)
  117. end 
  118.  
  119. on getQTVRParams
  120.   put QTVRgetNodeID(gQTVRObj) into nID
  121.   put QTVRgetPanAngle(gQTVRObj) into panAngle
  122.   put QTVRgetFOV(gQTVRObj) into FOV
  123.   put QTVRgetTiltAngle(gQTVRObj) into tiltAngle
  124.   return [nId, panAngle, FoV, tiltAngle]
  125. end
  126.  
  127.  
  128. on resetCallbackCheckboxes
  129.   set the hilite of member "MouseOverHandler Check" = false
  130.   set the hilite of member "RolloverHotSpotHandler Check" = false
  131.   set the hilite of member "MouseDownHandler Check" = false
  132.   set the hilite of member "PanZoomStartHandler Check" = false
  133.   set the hilite of member "MouseStillDownHandler Check" = false
  134.   set the hilite of member "NodeLeaveHandler Check" = false
  135. end 
  136.  
  137.  
  138. on rolloverHS hotspotID 
  139.   global gQTVRObj,gBlankRO, cockpitController
  140.   
  141.   --  QTVRUpdate(gQTVRObj)
  142.   
  143.   set nodeID = QTVRGetnodeID(gQTVRObj)
  144.   put hotspotID&&"rollover"&&nodeID
  145.   if hotspotID <>0 then
  146.     set converter = (integer(hotspotID) * 100) + integer(nodeID)
  147.     set name = "qtvr-"&(string(converter))
  148.     set the member of sprite 10 = name
  149.     repeat while soundBusy(3)
  150.     end repeat
  151.     puppetsound 3,"qtvrroll"&random(5)
  152.   else
  153.     set the castnum of sprite 10 to gBlankRO
  154.   end if
  155.   updateStage
  156. end
  157.  
  158. on rolloverM
  159. end
  160.  
  161. on mousedownM 
  162.   put "mousedownM"
  163. end
  164.  
  165. on mouseSdownM
  166.   put "mouseSdownM"
  167. end
  168.  
  169. on PanZoom
  170.   put "PanZoom"
  171. end
  172.  
  173. on NodeLeave
  174.   put "NodeLeave"
  175. end
  176.  
  177. on getview
  178.   global gPan,gFov,gTilt,gQTVRObj,gNodeId
  179.   put QTVRgetNodeID(gQTVRObj) into gNodeId
  180.   put QTVRgetPanAngle(gQTVRObj) into gPan
  181.   put QTVRgetFOV(gQTVRObj) into gFov
  182.   put QTVRgetTiltAngle(gQTVRObj) into gTilt
  183.   put gPan&&gFov&&gTilt
  184. end
  185.  
  186. on SetPanoNode nodeID, pUpdate, pQuality
  187.   global gQTVRObj
  188.   if IsQTVRMovie(gQTVRObj) then
  189.     -- we'll just set the ID to 5 for now
  190.     QTVRSetNodeID(gQTVRObj, 5)   
  191.     QTVRUpdate(gQTVRObj)
  192.   end if
  193. end
  194.  
  195.  
  196. on SetMovieView pPan, pTilt, pFOV, pQuality
  197.   global gQTVRInstance
  198.   
  199.   if IsQTVRMovie(gQTVRInstance) then
  200.     -- in QTVR 1.0 objects can't zoom:
  201.     if QTVRGetQTVRType(gQTVRInstance) = "QTVRPanorama" then QTVRSetFOV(gQTVRInstance,pFOV)
  202.     
  203.     QTVRSetTiltAngle(gQTVRInstance,pTilt)
  204.     QTVRSetPanAngle(gQTVRInstance,pPan)
  205.     if not voidP(pQuality) then QTVRSetQuality(gQTVRInstance, pQuality)
  206.     QTVRUpdate(gQTVRInstance)
  207.   end if
  208. end
  209.  
  210.  
  211.  
  212. -----------------------------------------
  213. -----        General Handlers
  214. -----------------------------------------
  215. on puppetoff
  216.   puppetsprite 2, false
  217.   repeat with i=24 to 28
  218.     puppetsprite i, false
  219.   end repeat
  220.   
  221. end
  222.  
  223. on ResetInfo  
  224.   global gInfoSprt,gIImage
  225.   if  gInfoSprt<>"" then   
  226.     set the castnum of sprite gInfoSprt to the castnum of sprite gInfoSprt -2 
  227.   end if
  228.   
  229.   set gInfoSprt=""
  230.   set gIImage=""
  231.   
  232.   updatestage
  233. end
  234.  
  235. on ResetTour
  236.   global gSelct,gImage,gTourCast, NumOfQTVRMenuItems
  237.   set gSelct=""
  238.   set gImage=""
  239.   
  240.   set qtvrPlaneSprNum = getSpriteNumFromMemberName("qtvranchor")+1
  241.   set range = NumOfQTVRMenuItems - 1
  242.   
  243.   repeat with i=qtvrPlaneSprNum to qtvrPlaneSprNum+range
  244.     puppetSprite i, false
  245.     set the visible of sprite i to false
  246.   end repeat
  247.   
  248. end 
  249.  
  250.  
  251. on resetSubMENUs
  252.   repeat with i=11 to 15
  253.     puppetSprite i, False
  254.   end repeat
  255. end
  256.  
  257.  
  258. on getSpriteNumFromMemberName memberName
  259.   repeat with spriteNum = 1 to 120
  260.     if the memberNum of sprite spriteNum <> 0 then --if there is a sprite in channel
  261.       
  262.       set M = the member of sprite spriteNum
  263.       if the name of member M = memberName then
  264.         return spriteNum
  265.         exit
  266.       end if
  267.       
  268.     end if  
  269.   end repeat
  270.   return 0
  271. end
  272.  
  273. on getNumOfSprInCluster anchorSpriteName
  274.   set value = 0
  275.   set anchorSpriteNumber = getSpriteNumFromMemberName(anchorSpriteName)
  276.   
  277.   repeat with spriteNum = anchorSpriteNumber+1 to 120
  278.     if the memberNum of sprite spriteNum <> 0 then
  279.       set value = value +1
  280.     else
  281.       return value
  282.       exit
  283.     end if
  284.   end repeat
  285.   
  286.   return value
  287. end
  288.  
  289. on setmovieMenuPuppets TrueOrFalse
  290.   set startSprNum = getSpriteNumFromMemberName ("anchor")+1
  291.   set range = getNumOfSprInCluster("anchor")-1
  292.   
  293.   repeat with spriteNum=startSprNum to startSprNum+range   
  294.     puppetSprite spriteNum, TrueOrFalse
  295.   end repeat
  296. end
  297.  
  298. on switchMovie marker
  299. --  set markerList = [#global:"gx",#se:"se",#ch604:"604",#lear60:"60",¼
  300. --                   #lear45:"45",#lear31a:"31a",#customer:"cs",#business:"bjs"]
  301. --  set movieName = symbol(marker)
  302. --  set soundSuffix = getaProp(markerList,movieName)
  303. --  puppetsound 3, "mousemulti_"&soundSuffix
  304. --  closeMovie
  305. --  clearpups
  306. --  setmovieMenuPuppets false
  307. --  go to  marker
  308. end
  309.  
  310. on checkSound
  311.   global gselct
  312.   if gselct = 102 then
  313.     if  not soundbusy(2) then
  314.       sound stop 1
  315.       puppetsound 2, "qtvrckpt"
  316.     end if
  317.   else
  318.     if not soundbusy(1) then
  319.       sound stop 2
  320.       puppetsound 1, "qtvrckpt"
  321.     end if
  322.   end if
  323. end 
  324.  
  325. on initObjects
  326.   global menuController,cockpitController
  327.   
  328.   set menuController = new (script "menuController")
  329.   if not (the movie = "bjs.dir" or the movie = "cs.dir" or the movie = "bombinc.dir") then
  330.     set cockpitController = new (script "cockpitController")
  331.   end if
  332.   
  333. end
  334.  
  335. on skipVideo
  336.   oxiStop(sprite 31)
  337.   initObjects
  338.   go to "start"
  339. end
  340.  
  341. on viewCockpitDetail
  342.   global  cockpitRetFrame
  343.   set cockpitRetFrame = the frame
  344.   puppetsprite 10, false
  345.   set the visible of sprite 110 = FALSE
  346.   sound stop 1
  347.   go to "cockpit_detail"
  348.   cursor -1
  349.   puppetsound 3, "mouse5"
  350. end